## while循环语法

# 案例1
# num = int(input('请输入一个值：'))
# while num < 10:
#     print(num)
#     num +=1

# 案例2
# sum = 0
# a = 0
# while a<5:
#     sum+=a # 求和
#     a+=1
# print('和为：', sum)

# 案例3 计算1~100之间的偶数和
sum = 0
a = 0
while a<=100:
    if a%2 == 0:
        sum+=a
    a+=1
print('计算1~100之间的偶数和：', sum)